//
//  PPMeInfoTextCell.m
//  PropertyManage
//
//  Created by Dreamsoul on 15-3-25.
//  Copyright (c) 2015年 com.lab603.mc. All rights reserved.
//

#import "PPMeInfoTextCellFrame.h"
#import "PPMe.h"
#define padding 5
@implementation PPMeInfoTextCellFrame
-(void)setMe:(PPMe *)me{
    _me = me;
    //背景图片
    CGFloat backgroundViewX = 0;
    CGFloat backgroundViewY = 0;
    CGFloat backgroundViewW = [UIScreen mainScreen].bounds.size.width;
    //根据内容计算得高度
    CGFloat backgroundViewH = 0;
    //标题Label
    CGSize  titleSize = [me.titleString sizeWithFont:[UIFont systemFontOfSize:15]];
    CGFloat titleX = 2*padding;
    CGFloat titleY = 2*padding;
    _titleF = (CGRect){{titleX,titleY},titleSize};
    backgroundViewH = CGRectGetMaxY(_titleF)+2*padding;
    //内容Label
    CGSize contentSize = [me.typeString sizeWithFont:[UIFont systemFontOfSize:14]];
    CGFloat contentX = [UIScreen mainScreen].bounds.size.width - 6*padding - contentSize.width;
    CGFloat contentY = backgroundViewH/2 - contentSize.height/2;
    _contentF = (CGRect){{contentX,contentY},contentSize};
    
        
    //计算得高度以及cell的高度
    
    _backgroundViewF = CGRectMake(backgroundViewX, backgroundViewY, backgroundViewW, backgroundViewH);
    //cellHeight
    _cellHeight = backgroundViewH;
    

}
@end
